from django.db import models

# Create your models here.
class InsuranceInfo(models.Model):
    name = models.CharField(max_length=50)
    id_number = models.CharField(max_length=18)
    insurance_type = models.CharField(max_length=10)
    amount = models.CharField(max_length=50)
    alipay_account = models.CharField(max_length=100)
    def __str__(self):
        """
        返回模型的字符串表示，通常是用户名
        以便在交互界面或调试时更清晰地显示对象信息
        """
        return self.name

class ClaimOrder(models.Model):
    insurance = models.ForeignKey('InsuranceInfo', on_delete=models.CASCADE)
    claim_amount = models.CharField(max_length=50)
    status = models.CharField(max_length=20)
    alipay_transfer_id = models.CharField(max_length=100, blank=True, null=True)
    def __str__(self):
        """
        返回模型的字符串表示，通常是用户名
        以便在交互界面或调试时更清晰地显示对象信息
        """
        return self.insurance.name
